<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>switch加减乘除运算</title>
	</head>
	<body>
		<script>
			var num1=parseInt(prompt("亲，请输入第一个整数："));
			var num2=parseInt(prompt("亲，请输入第二个整数："));
			var num3=parseInt(prompt("1.+ 2.- 3.* 4./"));
			
			switch(num3){
				case 1:
				      alert(num1+num2);
				break;
				
				case 2:
				      alert(num1-num2);
				break;
				
				case 3:
				      alert(num1*num2);
				break;
				
				case 4:
				      alert(num1/num2);
				break;
				
				default:
				      alert("错误");
				break;
				
			}
			
		</script>
	</body>
</html>
